<?php

namespace Common\Service;


Class SsoService extends BaseService
{

    public function getUid($channel, $openid)
    {
        $res = $this->where(compact('channel', 'openid'))->find();
        return $res ? $res['uid'] : 0;
    }

    public function addNew($channel, $openid, $uid, $open = [])
    {
        $save = compact('channel', 'openid', 'uid', 'open');
        $res = $this->add($save);
        return $uid;
    }
    
}